<navbar></navbar>
<div class="tabwrapper">
<div class="col-sm-12"  ng-controller="orderlistCtrl">
    <div class="jumbotron" ng-switch="vm.activeTab">
        <div ng-switch-when="6">
            <h2 class="text-center">全部订单</h2>
        </div>
        <div ng-switch-when="0">
            <h2 class="text-center">待接订单</h2>
        </div>
        <div ng-switch-when="1">
            <h2 class="text-center">已接订单</h2>
        </div>
        <div ng-switch-when="2">
            <h2 class="text-center">被拒订单</h2>
        </div>
        <div ng-switch-when="3">
            <h2 class="text-center">配送中订单</h2>
        </div>
        <div ng-switch-when="4">
            <h2 class="text-center">已完成订单</h2>
        </div>
        <div ng-switch-when="5">
            <h2 class="text-center">已取消订单</h2>
        </div>
    </div>
</div>

<div>
  <ul class="nav nav-tabs" ng-init="vm.activeTab=6">
    <li ng-class="{active: vm.activeTab == 6}"><a href="javascript:;" ng-click="vm.loadorder(6)">全部订单</a></li>
    <li ng-class="{active: vm.activeTab == 0}"><a href="javascript:;" ng-click="vm.loadorder(0)">待接订单</a></li>
    <li ng-class="{active: vm.activeTab == 1}"><a href="javascript:;" ng-click="vm.loadorder(1)">已接订单</a></li>
    <li ng-class="{active: vm.activeTab == 2}"><a href="javascript:;" ng-click="vm.loadorder(2)">被拒订单</a></li>
    <li ng-class="{active: vm.activeTab == 3}"><a href="javascript:;" ng-click="vm.loadorder(3)">配送中订单</a></li>
    <li ng-class="{active: vm.activeTab == 4}"><a href="javascript:;" ng-click="vm.loadorder(4)">已完成订单</a></li>
    <li ng-class="{active: vm.activeTab == 5}"><a href="javascript:;" ng-click="vm.loadorder(5)">已取消订单</a></li>
  </ul>
  <div class="tab-content tab-bordered">
    <div class="tab-panel">
        <table class="table table-hover table-condensed">
            <thead>
                <tr>
                    <th rowspan="1"><input type="checkbox" ng-model="vm.allChecked" ng-change="vm.checkAll(vm.allChecked)" /></th>
                    <th rowspan="2">订单ID</th>
                    <th rowspan="1">商家头像</th>
                    <th rowspan="1">商家名称</th>
                    <th rowspan="2">收件人</th>
                    <th rowspan="2">订单总价</th>
                    <th rowspan="1">订单状态</th>
                    <th rowspan="2">下单时间</th>
                    <th rowspan="2">订单详情</th>
                </tr>
            </thead>

            <tbody>
                <tr ng-repeat="item in vm.olist">
                    <td><input type="checkbox" ng-model="item.$checked" /></td>
                    <td>{{item._id}}</td>
                    <td><img style="width:50px;" ng-src='{{item.merchant.portait}}' class="text-center"></td>
                    <td>{{item.mname}}</td>
                    <td>{{item.deliverInfo.contact}}</td>
                    <td>{{item.osum}}</td>
                    <td ng-switch="item.ostate">
                        <span ng-switch-when="0">等待商家接单</span>
                        <span ng-switch-when="1">商家已接单</span>
                        <span ng-switch-when="2">商家已拒单</span>
                        <span ng-switch-when="3">外卖配送中</span>
                        <span ng-switch-when="4">订单已完成</span>
                        <span ng-switch-when="5">订单已取消</span>
                    </td>
                    <td>{{item.otime  | date: 'yyyy-MM-dd HH:mm:ss' }}</td>
                    <td><button class="btn btn-primary" ng-click="vm.detail(item._id)">详情</button></td>
                </tr>
            </tbody>
        </table>
    
    </div>    

  </div>
</div>
</div>
